package io.github.junxworks.qt.modules.stock.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.github.junxworks.ep.core.Result;
import io.github.junxworks.qt.modules.stock.service.SWService;

@RestController
@RequestMapping("/sw")
public class SWController {

	@Autowired
	private SWService swService;

	@GetMapping("/category/{parentCode}")
	public Result querySWCategories(@PathVariable("parentCode") String parentCode) {
		return Result.ok(swService.querySWCatetoriesByParentCode(parentCode));
	}

}
